<?php
namespace app\common\logic;

class RandCreateStrLogic
{
    /**
     * 随机生成指定长度字符串 
     * @author 吴伟亮
     * @return string
     */
    public function create(int $len)
    {
        $chars='ABCDEFGHJKLMNPQRSTUVWXYZ23456789abcdefghjkmnpqrstuvwxyz';
        $string='';
        for ( $i = 0; $i < $len; $i++ ) 
        {
            $string .= $chars[ mt_rand(0, strlen($chars) - 1) ]; 
        }

        return $string;
    }
}
